<?php
$addressid = empty($_GET['addressid']) ? 0 : intval($_GET['addressid']);

$r['result'] = 'fail';
if(empty($addressid)){
	$r['errmsg'] = '参数丢失';
	echo json_encode($r);
	exit;
}
$oAddress = new Address();
$address = $oAddress->get_row($addressid);
if(!empty($address)){
	$citys = $oAddress->get_citys($address['province_id']);
	$address['city_id'] = make_options($citys, '', $address['city_id']);
	$areas = $oAddress->get_areas($address['city_id']);
	$address['area_id'] = make_options($areas, '', $address['area_id']);	
	$r['result'] = 'succ';
	$r['address'] = $address;
}
exit(json_encode($r));
?>